package com.mls.fivedistrict.pojo;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 快讯
 * </p>
 *
 * @author Five Team
 * @since 2018-06-04
 */
@Data
@Accessors(chain = true)
@TableName("t_news_flash")
public class NewsFlash extends Model<NewsFlash> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 快讯标题
     */
    @NotBlank(message = "快讯标题不能为空!")
    private String title;
    private String digest;
    /**
     * 快讯内容
     */
    @NotBlank(message = "快讯内容不能为空!")
    private String newsContent;
    /**
     * 阅读次数
     */
    private Integer readCount;
    /**
     * 点赞次数
     */
    private Integer likeCount;
    /**
     * 分享次数
     */
    private Integer shareTimes;

    private Integer orders;
    /**
     * 置顶：top为1代表置顶
     */
    private Boolean top;
    private Date createDate;
    private Date updateDate;
    private String createBy;
    /**
     * 作者
     */
    private String auther;
    /**
     * 编辑人
     */
    private String editor;
    @TableLogic
    private Boolean isDelete;
    private Boolean isEnable;
    /**
     * 奖励DWQ数量
     */
    @Min(value = 0, message = "奖励的DWQ量不能为负数")
    private BigDecimal rewardDwqNumber;

    /**
     * 点赞奖励dwq数量
     */
    private BigDecimal likeDwqNumber;
    /**
     * 分享奖励的dwq数量
     */
    private BigDecimal shareDwqNumber;
    /**
     * 快讯分类
     */
    private Long classifyId;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public Boolean getDelete() {
        return isDelete;
    }

    public void setDelete(Boolean delete) {
        isDelete = delete;
    }

    public Boolean getEnable() {
        return isEnable;
    }

    public void setEnable(Boolean enable) {
        isEnable = enable;
    }
}
